﻿<%--
   Copyright 2012 University of Southampton

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
--%>

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DelimitedFileViewer.aspx.cs" Inherits="uk.ac.soton.ses.layouts.DelimitedFileViewer" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>

<%@ Register TagPrefix="hdc" Namespace="uk.ac.soton.ses.WebControls" Assembly="HDCWebControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=be2a37f6f7c4bcce" %>

<html>

<head id="ReportHeader" runat="server">
<title>Delimited File Viewer</title>
<style type="text/css">
    
    /*#ReportTable{font-family:Sans-Serif;font-size:10pt;}*/
    body {font-family:Sans-Serif;font-size:10pt;}
    #ReportTable td,#ReportTable th {padding:0px 10px 0px 10px;text-align:left;}
    #ReportTable th {font-weight:bold;}
    #ReportTable td { border: 1px solid grey;}

    @media screen
    {
        
        #ReportConfigurationDiv {float:left;width:280px}
        #ReportOutputDiv {margin-left:300px}

        #ReportOptions{height:36%;}
        #FieldSelectionParentDiv{height:59%;}
        #ReportTableDiv {height:95%;overflow:scroll;}
        
        #FieldSelectionTitleDiv{height:25px;}
        #FieldSelectionDiv{height:88%;overflow:auto;}
        #FieldSelectionDiv table{font-size:8pt;}
        
        .OptionLabel{float:left;width:12em;clear:left;}
        .OptionBox{float:left;width:3em;}
        .OptionDiv{background-color:#aaffaa;}
        .SelectionDiv{background-color:#bbddff;}
        .InfoDiv{background-color:#dddddd;}
        
    }
    
    @media print
    {
        .NonPrintDiv{display:none;}
        #ReportTable{font-family:Serif}
    }
</style>
</head>

<body>
<form ID="form" runat="server">
    <div id="ReportConfigurationDiv" class="ReportDiv NonPrintDiv">
        <div id="ReportOptions">
                <div class="InfoDiv" style="float:left;width:100%;">
                    <b>File has <asp:Label ID="lbl_LineCount" runat="server" /> lines.
                    Showing <asp:Label ID="lbl_MaxRows" runat="server" /> lines starting at line <asp:Label ID="lbl_StartRow" runat="server" />.</b>
                </div>
                <%--<div>--%>
                <div class="OptionDiv" style="clear:left;float:left; width:100%; ">
                    <ul class="NoBullets" style="line-height:2em;padding-left:15px;margin-top:5px;">
                        <li>
                            <span>
                                <label class="OptionLabel">Start row:</label>
                                <asp:TextBox ID="txt_StartRow" runat="server" Text="0"  CssClass="OptionBox" />
                            </span>
                        </li>
                        <li>
                            <span>
                                <label class="OptionLabel">Max rows:</label>
                                <asp:TextBox ID="txt_Rows" runat="server" Text="10" CssClass="OptionBox" />
                            </span>
                        </li>
                        <li>
                            <span>
                                <label class="OptionLabel">Column delimiter ('\t'=tab):</label>
                                <asp:TextBox ID="txt_Delimeter" runat="server" Text="\t" CssClass="OptionBox" />
                            </span>
                        </li>
                        <li>
                            <span>
                                <span class="OptionLabel">
                                    <asp:CheckBox ID="chk_UseHeaderRow" runat="server" Text="Use header row on line:" Checked="true" AutoPostBack="true" />
                                </span>
                                <asp:TextBox ID="txt_HeaderRow" runat="server" Text="0" CssClass="OptionBox" />
                            </span>
                        </li>
                    </ul>
                </div>
                <div class="InfoDiv" style="clear:left;width:100%;text-align:center;">
                    <asp:LinkButton ID="btn_OK1" runat="server" Text="Refresh" />
                </div>


<%--                    <div class="OptionLabel">Start row:</div>
                    <div class="OptionBox"><asp:TextBox ID="txt_StartRow" runat="server" Text="0" Width="5em" /></div>

                    <div style="clear:left;"></div>

                    <div class="OptionLabel">Max rows:</div>
                    <div class="OptionBox"><asp:TextBox ID="txt_Rows" runat="server" Text="10"  Width="5em"/></div>
                    
                    <div style="float:left; margin-left:3em;"><asp:LinkButton ID="btn_OK1" runat="server" Text="Refresh" /></div>

                    <div style="clear:left;"></div>

                    <div class="OptionLabel">Column delimiter ('\t'=tab):</div>
                    <div class="OptionBox"><asp:TextBox ID="txt_Delimeter" runat="server" Text="\t" width="5em"/></div>
--%>
                    <%--<asp:CheckBox ID="chk_LimitRows" runat="server" Text="Limit number of rows:"/>--%>
                <%--</div>--%>
        </div>
        <div id="FieldSelectionParentDiv" class="SelectionDiv">
            <div id="FieldSelectionTitleDiv">
                <b>Field selection:</b>
            </div>
            <div id="FieldSelectionDiv">
                <asp:CheckBoxList ID="List_Fields" runat="server" AutoPostBack="true" ></asp:CheckBoxList>
            </div>
        </div>
    </div>
    <div id="ReportOutputDiv" class="ReportDiv">
        <div id="ReportTableDiv">
            <table border="0" cellpadding="0" cellspacing="0" runat="server" id="ReportTable">
            </table>
        </div>
        <asp:Panel id="ReportButtons" class="NonPrintDiv" runat="server">
            <asp:LinkButton ID="btn_SaveReport" runat="server" Text="Save link to report as parameter" />
            &nbsp;&nbsp;&nbsp;<asp:LinkButton ID="btn_ExportReport" runat="server" Text="Export report to file" />
            &nbsp;&nbsp;&nbsp;<asp:LinkButton ID="btn_ImportSelectedData" runat="server" Text="Import selected data as metadata" />
            &nbsp;&nbsp;&nbsp;<asp:LinkButton ID="btn_GraphFile" runat="server" Text="Generate X Y Graph" />
        </asp:Panel>
    </div>
</form>
</body>

</html>